package com.example.studyspringdemo.service.impl;

import com.example.studyspringdemo.bean.User;
import com.example.studyspringdemo.mapper.UserMapper;
import com.example.studyspringdemo.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service("UserService")
public class UserServiceImpl implements UserService {
    @Autowired
    private UserMapper userMapper;
    @Override
    public List<User> selectAll() {
        return userMapper.selectAll();
    }

    @Override
    public int saveUser(User user0) {
        return userMapper.saveUser(user0);
    }

    @Override
    public List<User> selectUsersByUserName(String userName) {
        return userMapper.selectUserByUserName(userName);
    }

    @Override
    public List<User> selectUsersByEmail(String email) {
        return userMapper.selectUserByEmail(email);
    }
}
